package com.olah.common.entity.po.msg.system;

import cn.hutool.core.date.DateUtil;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

/**
 * 系统消息
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class SystemMsg {

    // 消息 id
    private Integer id;

    // 用户 id
    private Integer userId;

    // 消息内容
    private String data;

    //是否已读
    private Boolean read = false;

    // 消息类型
    private SystemMsgType type;

    // 消息发布时间
    private String time = DateUtil.formatDateTime(new Date());

    public SystemMsg(Integer userId, String data, SystemMsgType type) {
        this.userId = userId;
        this.data = data;
        this.type = type;
    }

}
